/*****************************************************
Copyright (C) 2020. All rights reserved.
File name     ：PairingHeap.h
Version       ：v1.0
Author        ：zhengqijun
Date          ：2020-05-09
Function List ：
Description   ：Pairing Heap
******************************************************/

#ifndef PAIRINGHEAP_H_
#define PAIRINGHEAP_H_

// Type Definition
struct PairNode;
typedef int ElementType;
typedef struct PairNode *Position;
typedef struct PairNode *PriorityQueue;

// Function Lists
PriorityQueue Initialize(void);
PriorityQueue Destroy(PriorityQueue H);
int IsEmpty(PriorityQueue H);
PriorityQueue Insert(ElementType Item, PriorityQueue H, Position *Loc);
PriorityQueue DeleteMin(ElementType *MinItem, PriorityQueue H);
ElementType FindMin(PriorityQueue H);
PriorityQueue DecreaseKey(Position P, ElementType NewVal, PriorityQueue H);
PriorityQueue Merge(PriorityQueue H1, PriorityQueue H2);
Position LeftChild(Position P);
Position NextSibling(Position P);
ElementType Retrieve(Position P);

#endif  /* PAIRINGHEAP_H_ */

// EOF

